def validate_selection(pattern: str, modes: list) -> tuple[bool, str]:
    """验证用户选择的参数是否有效"""
    valid_patterns = [
        "默认方形", "圆形阵列", "线性排列", "菱形网格",
        "波浪形", "星形", "十字形", "菱形", "梯形",
        "椭圆形", "心形", "六边形蜂窝", "三角形阵列", "单拼基底"
    ]

    valid_modes = ["单拼", "双拼", "三拼", "四拼"]

    # 验证图案类型
    if not pattern or pattern not in valid_patterns:
        return False, "请选择有效的图案类型"

    # 验证拼摆方式
    if not modes or any(mode not in valid_modes for mode in modes):
        return False, "请选择有效的拼摆方式"

    return True, "输入有效"